package com.example.toy.core.reader;

import com.example.toy.core.commit.CommitMsg;
import com.example.toy.core.dataset.BigCollection;
import com.example.toy.core.filter.ToyFilter;
import com.example.toy.core.record.ToyRecord;
import com.example.toy.core.table.ToyTableMeta;
import com.example.toy.core.version.ToyVersion;
import com.example.toy.core.utils.VersionHelper;
import java.util.List;
import java.util.Optional;

import org.apache.avro.Schema;
import org.apache.hadoop.fs.Path;

public class DefaultToyDeltaFileReader implements ToyFileReader {
  private final Path path;
  private final ToyTableMeta tableMeta;
  private final ToyVersion version;
  private final Schema schema;

  public DefaultToyDeltaFileReader(ToyTableMeta meta, Path path) {
    this.path = path;
    this.tableMeta = meta;
    this.version = VersionHelper.fromPath(path);

    Optional<CommitMsg> commit = meta.getCommitView().getCommit(version);
    this.schema = commit.get().getSchema();
  }

  @Override
  public List<ToyRecord> read(ToyFilter... filters) {
    return null;
  }

  @Override
  public BigCollection<ToyRecord> parRead(ToyFilter... filters) {
    return null;
  }
}
